package com.beiding.dbrequest.server;

import io.netty.channel.ChannelHandlerContext;

import java.util.List;
import java.util.Random;

/**
 * @author 丁常磊
 * @date 2021/9/22 9:58
 */

public class RandomChannelSelector implements ChannelSelector {

    @Override
    public ChannelHandlerContext getOne(List<ChannelHolderForSelect> contexts) {
        return contexts.get(new Random().nextInt(contexts.size())).getChannelHandlerContext();
    }
}
